import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * <p>****************************************************************************</p>
 * <p><b>Copyright © 2010-2019 shuncom team All Rights Reserved<b></p>
 * <ul style="margin:15px;">
 * <li>Description : PACKAGE_NAME</li>
 * <li>Version     : 1.0.0</li>
 * <li>Creation    : 2019年10月14日</li>
 * <li>@author     : zzy0_0</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
public class Test {
	public static void main(String[] args) {
		SpringTemplateEngine templateEngine = new SpringTemplateEngine();
		//language=HTML
		String template = "<!DOCTYPE html>\n" +
				"<html xmlns:th=\"http://www.thymeleaf.org\">\n" +
				"<body>\n" +
				"<tr th:each=\"map : ${message}\">\n" +
				"    " +
				"<td th:each=\"a : ${map}\" th:text=\" ${a}\"></td>\n" +
				"</tr>\n" +
				"</body>\n" +
				"</html>";

		Context context = new Context();
		HashMap h = new HashMap();
		ArrayList a = new ArrayList();
		a.add(1);
		a.add(2);
		h.put("a", a);
		context.setVariable("message", a);

		System.out.println(templateEngine.process(template, context));
	}
}